package com.itfitness.stretchcalendarview

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ImageView
import com.itfitness.stretchcalendarview.widget.calendarview.widget.StretchCalendarView

class StretchCalendarActivity : AppCompatActivity() {
    private val scvDate : StretchCalendarView? by lazy { findViewById(R.id.scv_date) }
    private val imgStretch : ImageView? by lazy { findViewById(R.id.img_stretch) }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_stretchcalendar)
        initDate()
        imgStretch?.setOnClickListener {
            scvDate?.stretch()
            if(scvDate?.mStretch!!){
                imgStretch?.rotation = 0f
            }else{
                imgStretch?.rotation = 180f
            }
        }
    }

    private fun initDate() {
        scvDate?.initData(2024,1,1)
    }
}